<div class="best index">
<h2><?php echo __('Best Teams (Season)', true).': '.$fieldTitle;?></h2>
<table cellpadding="0" cellspacing="0">
	<tr>
		<th><?php echo '#';?></th>
		<th><?php echo 'Name';?></th>
		<th><?php echo 'Coach';?></th>
		<th><?php echo 'Race';?></th>
		<th><?php echo $fieldName;?></th>
		<th><?php echo 'Val';?></th>
	</tr>
	<?php
	$i = 0;
	foreach ($statisticsSeasonTeams as $statisticsSeasonTeam):
	$class = null;
	if((!empty($statisticsSeasonTeam['Team']['Coach']))
			&& $statisticsSeasonTeam['Team']['Coach']['ID'] == $coach_id) {
		$class = ' class="mine';
	} else {
		$class = ' class="';
	}
	if ($i++ % 2 == 0) {
		$class .= ' altrow"';
	} else {
		$class .= '"';
	}
	?>
	<tr <?php echo $class;?>>
		<td><?php echo $i; ?></td>
		<td nowrap="nowrap" ><?php echo $html->link($statisticsSeasonTeam['Team']['strName'], array('controller' => 'teams', 'action' => 'view', $statisticsSeasonTeam['Team']['ID'])); ?>&nbsp;</td>
		<td nowrap="nowrap"><?php
		if(!empty($statisticsSeasonTeam['Team']['Coach'])) {
			echo $html->link($statisticsSeasonTeam['Team']['Coach']['strName'], array('controller' => 'coaches', 'action' => 'view', $statisticsSeasonTeam['Team']['Coach']['ID']));
		} else {
			echo 'Unknown';
		}
		?>&nbsp;</td>
		<td nowrap="nowrap"><?php echo $html->link($statisticsSeasonTeam['Team']['Race']['LocalizedString'][$locale], array('controller' => 'races', 'action' => 'view', $statisticsSeasonTeam['Team']['Race']['ID'])); ?>&nbsp;</td>
		<td><?php echo $statisticsSeasonTeam['StatisticsSeasonTeam'][$field]; ?>&nbsp;</td>
		<td><?php echo $statisticsSeasonTeam['Team']['iValue']; ?>&nbsp;</td>
	</tr>
	<?php endforeach; ?>
</table>
</div>
<div class="actions">
	<ul>
		<li><?php echo $html->link(__('Most TDs', true), array('action' => 'get_bestteams', 'td'));?></li>
		<li><?php echo $html->link(__('Less Sustained TDs', true), array('action' => 'get_bestteams', 'std'));?></li>
		<li><?php echo $html->link(__('Most Passes', true), array('action' => 'get_bestteams', 'pa'));?></li>
		<li><?php echo $html->link(__('Less Sustained Passes', true), array('action' => 'get_bestteams', 'spa'));?></li>
		<li><?php echo $html->link(__('Most Catches', true), array('action' => 'get_bestteams', 'ca'));?></li>
		<li><?php echo $html->link(__('Less Sustained Catches', true), array('action' => 'get_bestteams', 'sca'));?></li>
		<li><?php echo $html->link(__('Most Meter Passing', true), array('action' => 'get_bestteams', 'mp'));?></li>
		<li><?php echo $html->link(__('Less Sustained Meter Passing', true), array('action' => 'get_bestteams', 'smp'));?></li>
		<li><?php echo $html->link(__('Most Interceptions', true), array('action' => 'get_bestteams', 'int'));?></li>
		<li><?php echo $html->link(__('Less Sustained Interceptions', true), array('action' => 'get_bestteams', 'sint'));?></li>
		<li><?php echo $html->link(__('Most Meter Running ', true), array('action' => 'get_bestteams', 'mr'));?></li>
		<li><?php echo $html->link(__('Less Sustained Meter Running ', true), array('action' => 'get_bestteams', 'smr'));?></li>
		<li><?php echo $html->link(__('Most Injuries', true), array('action' => 'get_bestteams', 'inj'));?></li>
		<li><?php echo $html->link(__('Less Sustained Injuries', true), array('action' => 'get_bestteams', 'sinj'));?></li>
		<li><?php echo $html->link(__('Most Casualties', true), array('action' => 'get_bestteams', 'cas'));?></li>
		<li><?php echo $html->link(__('Less Sustained Casualties', true), array('action' => 'get_bestteams', 'scas'));?></li>
		<li><?php echo $html->link(__('Most Deads', true), array('action' => 'get_bestteams', 'dd'));?></li>
		<li><?php echo $html->link(__('Less Sustained Deads', true), array('action' => 'get_bestteams', 'sdd'));?></li>
	</ul>
</div>